<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page trimDirectiveWhitespaces="true" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>${result.ProductInfo.SPMC}</title>
    <meta name="keywords" content="${result.ProductInfo.SPGJC}"/>
    <meta name="description" content="${result.ProductInfo.SPSM}"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/res/css/base.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/res/css/style.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/res/css/media_index.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/res/css/mod.css">
</head>
<body onbeforeunload="$.Close()" style="background-color: #f5f5f5;">
    <%
	pageContext.setAttribute("basePath",request.getHeader("Referer"));
   %>
<div id="wrap1">
    <div id="header">
        <!--顶部开始-->
        <nav class="site-topbar">
            <div class="wraper">
                <ul class="nav-left">
                    <li><a href="#">首页</a></li>

                </ul>
                <ul class="nav-right">
                    <c:choose>
                        <c:when test="${result.YstUserInfo.YHBH!=null}">
                            <li class="userinfo">
                                <a href="/login.html">${result.YstUserInfo.YHMC}</a>
                                <div class="content">
                                    <div class="info">
                                        <a href="">
                                            <img src="${result.YstUserInfo.YHTX}" />
                                        </a>
                                        <a href="/user/logout.do">
                                            退出
                                        </a>
                                    </div>
                                </div>
                            </li>
                        </c:when>
                        <c:otherwise>
                            <li><a href="/login.html?url=${pageScope.basePath}">登录</a></li>
                            <li><a href="/login.html?url=${pageScope.basePath}">注册</a></li>
                        </c:otherwise>
                    </c:choose>
                    <li class="buyCar">
                        <a class="i_car" href="">购物车（0）</a>
                        <div class="content"></div>
                    </li>
                </ul>
            </div>
        </nav>
        <!--顶部结束-->

        <!--搜索框开始-->
        <div class="search-wraper wraper">
            <div class="header-left">
                <img src="http://yst.zuanweisi.com/res/images/logo.png"/>
            </div>
            <div class="header-right">
                <input type="text" class="search" list="search-record" name="search">
                <button class="btn">搜索</button>
                <ul>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                    <li>小米手机5<span>约有11件</span></li>
                </ul>
            </div>
        </div>
        <!--搜索框结束-->
        <!--导航条开始-->
        <div class="nav">

            <div class="block">
                <ul>
                    <c:forEach items="${result.YstInfoNav}" var="YstInfoNavF">
                        <%--为0是主导航--%>
                        <c:if test="${YstInfoNavF.FID==0&&YstInfoNavF.XIANSHI==1}">
                            <li>
                                <a href="<%=request.getContextPath()%>/${YstInfoNavF.DHURL}">${YstInfoNavF.DHMC}</a>
                                <ul>
                                    <c:forEach items="${result.YstInfoNav}" var="YstInfoNavZ">
                                        <%--主导航获取子导航--%>
                                        <c:if test="${YstInfoNavF.ZID==YstInfoNavZ.FID&&YstInfoNavZ.XIANSHI==1}">
                                            <li>
                                                <a href="<%=request.getContextPath()%>/${YstInfoNavZ.DHURL}">${YstInfoNavZ.DHMC}</a>
                                            </li>
                                        </c:if>
                                    </c:forEach>
                                </ul>
                            </li>
                        </c:if>

                    </c:forEach>
                </ul>
            </div>
        </div>
    </div>
    <!--导航条结束-->
<!--中部区域开始-->
<!-- 面包屑导航 -->
<div class="nav_bar">
    <div class="wrap">
        <a href="/">首页</a>
        &gt; <a href="">${result.TypeProductList[0].LXMC}</a>

    </div>
</div>
<!--类型商品列表-->
<div class="wrap">
    <div class="sequence">
        <a href="javascript:void(0)" data-order="1" class="sales ">销量</a>

        <a href="javascript:void(0)" data-order="2" class="prices">价格<span></span></a>

        <a href="javascript:void(0)" data-order="4" class="">上架时间</a>
    </div>
            <!--商品主体-->
            <div class="lxlist">
                <ul>
                    <c:forEach items="${result.TypeProductList}" var="TypeProduct">
                        <li class="in">
                            <a href="<%=request.getContextPath()%>/product/${TypeProduct.SPBH}.html" target="_blank">
                                    <%--一个商品图片字段  有多个商品--%>
                                <c:set value="${ fn:split(TypeProduct.SPTP, '|') }" var="SPTPList"/>
                                    <%--默认取第一个图片--%>
                                <img src="${SPTPList[0]}" alt="" title="${TypeProduct.SPSM}">

                            </a>
                            <p class="name ellipsis" title="${TypeProduct.SPSM}"
                               style="word-wrap: break-word; word-break: break-all;">${TypeProduct.SPMC}</p>
                            <p class="price">¥${TypeProduct.SPDJ-TypeProduct.SPYH}

                                <s>¥${TypeProduct.SPDJ}</s>


                            </p>
                            <div class="btns">
                                <a href="javascript:void(0)" class="buy"><span></span>加入购物车</a>
                            </div>
                        </li>
                    </c:forEach>
                </ul>
            </div>
        </div>
    </div>
    <script type="application/javascript" src="<%=request.getContextPath()%>/res/js/jquery-3.3.1.min.js"></script>
    <script type="application/javascript">
        $(function () {
            //点击更多
            $(".div_c").click(function () {
                $(".div_c").attr("class","div_c");
                $(this).attr("class","div_c on");
                var show=$(this).attr("show");
                $(".list-c").hide();
                $("."+show).show();
            });
        });
    </script>
<%@ include file="../footer.jsp" %>